package com.wangsong.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class MUserController {
	@Autowired  
	private KafkaTemplate<Integer, String> kafkaTemplate;  
	      
	
	@RequestMapping(value="/name")
	@ResponseBody
	public Object listUser(HttpServletRequest request,String name,Integer id) {
		
		kafkaTemplate.sendDefault(id,name);
		return name;  
		
		
		
	}
	
	
}
